<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%>

<%@ include file="/_taglib.jsp" %>

<%@ include file="/_navbar.jsp" %>

<section class="content">
	<div class="container" id="data-container">
		<div class="col-md-11">
			<form class="required-validate" role="form" action="sys/dictionary/dictType/save" method="post" onsubmit="return ajaxFormSubmit(this,'sys/dictionary/dictType/list')">
				<input type="hidden" name="dictType.id" value="${dictType.id}">
				<!-- general form elements disabled -->
				<div class="box">
					<div class="box-body">

						<div class="row">
							<div class="col-xs-3">
								<!-- text input -->
								<div class="form-group">
									<label>英文名称</label> 
									<input name="dictType.enName" value="${dictType.enName}" type="text" 
										class="form-control required" placeholder="Enter ...">
								</div>
							</div>
							<div class="col-xs-3">
								<div class="form-group">
									<label>中文名称</label> 
									<input name="dictType.cnName" value="${dictType.cnName}" type="text"
										class="form-control required" placeholder="Enter ...">
								</div>
							</div>
							<!-- 
                            <div class="col-xs-3">
                            	<input type="hidden" id="dict_type__creator" name="dictType.creator" class="query-field" op="eq" value="${dictType.creator}">
								<div class="form-group">
									<label>创建人</label>                             	
	                            	<div class="input-group">
		                             	<input type="text" id="f_dict_type__creator" name="f_dict_type_creator" class="query-field form-control suggest required" 
		                             		searchClass="org.jfk.sys.user.User" searchField="loginName" 
		                             		bringbackField="id" placeholder="创建人" op="eq" value="${dictType.creator_loginName}">
		                             	<span class="input-group-addon" lookupUrl="sys/user/list" id="l_dict_type__creator"><i class="fa fa-ellipsis-v"></i></span>
									</div>
								</div>
                            </div>
                             -->
							<div class="col-xs-3">
								<div class="form-group">
									<label>数据状态</label> 
									<j:select dictType="dataStatus" id="dictType.status" name="dictType.status" label="数据状态"/>
								</div>
							</div>
							
						</div>
						<div class="row">
							<div class="col-xs-12">
								<!-- textarea -->
								<div class="form-group">
									<label>描述</label>
									<textarea name="dictType.description" class="form-control" rows="3" placeholder="Enter ...">${dictType.description}</textarea>
								</div>
							</div>
						</div>


					</div>					<!-- /.box-body -->
					<div class="box-footer" align="center">
						<button type="submit" class="btn btn-primary">保存</button>
					</div>
				</div>				<!-- /.box -->
			</form>
		</div>
		
		<div class="col-md-11">
			<div class="box">
				<div class="box-header">
					所对应的数据字典值
                </div>			
				<div class="box-body">
					<table class="table" id="data-table" data-toggle="table"
						data-url="sys/dictionary/dictType/edit/${dictType.id}" 
						data-del-url="sys/dictionary/dict/del" 
						data-del-all-url="sys/dictionary/dict/delAll" 
						data-add-url="sys/dictionary/dict/edit?dict_type=${dictType.id}" 
	                    data-toolbar="#custom-toolbar"
	                    data-dialog="#dialog"
	                    data-pagination="false"
	                    data-search="false"
	                    data-sortable="false"
						data-total-rows="${page.totalRow }"
						data-total-page="${page.totalPage }"
						data-page-number="${page.pageNumber }"
						data-page-size="${page.pageSize }"
						<c:if test="${!empty sort}">data-sort-name="${sort}"</c:if>
						<c:if test="${!empty sort}">data-sort-order="${order}"</c:if>
						>
					    <thead>
						<tr>
					        <th data-field="state" data-checkbox="true">选择</th>
							<c:forEach items = "${dict_list_colFieldMapList}" var = "fieldItem" varStatus="status">
							<th data-field="${fieldItem.field}" data-align="center" data-sortable="true">${fieldItem.fieldName}
							</th>
							</c:forEach>
							<th data-align="center">操作</th>
						</tr>				    
					    </thead>
		                <c:forEach items = "${dict_list_page}" var = "item" varStatus="status">
						<tr>
							<td></td>
							<c:forEach items = "${dict_list_colFieldList}" var = "item1">
							<td>${item.get(item1) }</td>
							</c:forEach>
							<td>
								<div class="btn-group">
									<button onclick="loadAjaxContent('sys/dictionary/dict/edit/${item.id}')" class="btn btn-default" type="button" name="edit" title="编辑"><i class="glyphicon glyphicon-pencil"></i></button>
									<button class="btn" type="button" name="del" title="删除" onclick="del('${item.get('id')}');"><i class="glyphicon glyphicon-remove-sign"></i></button>
								</div>						
							</td>
						</tr>
						</c:forEach>				    
					</table>				
				</div>
			</div>
		</div>		
	</div>
</section>
<%@ include file="/_edit_js.jsp" %>
